package com.wlyuan.index.api.waybill.dto.combine;

import com.wlyuan.tools.Authentication;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @author yuanzheng
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class CombineCreationDTO extends Authentication {
    @ApiModelProperty("合单子单集合")
    @NotEmpty(message = "合单子单集合不能为空")
    @Size(min = 2, max = 100, message = "合单子单数必须大于1且小于等于100")
    @Valid
    private List<Long> waybillIds;

    @ApiModelProperty("合单合同号")
    @NotBlank(message = "合同编号不能为空")
    @Pattern(regexp = "^([a-zA-Z0-9]|(-|_|\\(|\\)|\\+|/|\\&|\\[|\\])){1,30}$", message = "请输入合同编号，只可输入数字、字母和特殊符号(-_()&+/[])，最多可输入30个字符")
    private String contractNo;

    @ApiModelProperty(value = "合单类型:0 普通合单，1：零担合单，2：整车合单", hidden = true)
    private Integer type;

    @ApiModelProperty("备注")
    @Length(max = 200, message = "备注不能超过200字符")
    private String remarks;

    @ApiModelProperty(value = "发货时间", hidden = true)
    private LocalDateTime fromTime;

    @ApiModelProperty(value = "到货时间", hidden = true)
    private LocalDateTime toTime;

//    @ApiModelProperty(value = "匹配合约key", hidden = true)
//    private JSONObject matchFeeKeys;

    @ApiModelProperty(value = "是否匹配费用", hidden = true)
    private Boolean matchFee;
}